﻿Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols

<Script.Services.ScriptService()> _
<WebService(Namespace:="http://code.google.com/p/jobjective//")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class WebService
    Inherits System.Web.Services.WebService

    Public Class Result
        Public Success As Boolean = False
        Public ErrorMessage As String
    End Class

    Public Class UserForm
        Public FirstName As String
        Public LastName As String
        Public ContactNumber As String
        Public Email As String
    End Class

    Public Class SubmitResult
        Inherits Result

        Public Greeting As String
    End Class

    <WebMethod()> _
    <Script.Services.ScriptMethod()> _
    Public Function SubmitForm(ByVal NewUser As UserForm) As SubmitResult
        Dim objRetVal As New SubmitResult

        Try
            With objRetVal
                .Greeting = "Hello " & NewUser.FirstName.Trim & " " & NewUser.LastName.Trim
                .Success = True
            End With
        Catch ex As Exception
            With objRetVal
                .Success = False
                .ErrorMessage = ex.Message
            End With
        End Try

        Return objRetVal
    End Function

End Class
